翻訳と辞書
Words near each other
・ Jumping Jacks
・ Jumping Johnny Wilson
・ Jumping Lake (Saskatchewan)
・ Jumping library
・ Jump Right In
・ Jump Right In (The Urge song)
・ Jump rings
・ Jump River
・ Jump River (CDP), Wisconsin
・ Jump River (disambiguation)
・ Jump River (town), Wisconsin
・ Jump River Town Hall
・ Jump Rope (song)
・ Jump Salty
・ Jump scare
Jump search
・ Jump seat
・ Jump seat (disambiguation)
・ Jump server
・ Jump shift
・ Jump Ship Quick
・ Jump shot
・ Jump shot (basketball)
・ Jump Shot Media
・ Jump smock
・ Jump Smokers
・ Jump Square
・ Jump start
・ Jump Start (comic strip)
・ Jump start (vehicle)


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Jump search : ウィキペディア英語版
Jump search
In computer science, a jump search or block search refers to a search algorithm for ordered lists. It works by first checking all items ''L''''km'', where k \in \mathbb and ''m'' is the block size, until an item is found that is larger than the search key. To find the exact position of the search key in the list a linear search is performed on the sublist ''L''(''km'' ).
The optimal value of ''m'' is √''n'', where ''n'' is the length of the list ''L''. Because both steps of the algorithm look at, at most, √''n'' items the algorithm runs in O(√''n'') time. This is better than a linear search, but worse than a binary search. The advantage over the latter is that a jump search only needs to jump backwards once, while a binary can jump backwards up to log ''n'' times. This can be important if a jumping backwards takes significantly more time than jumping forward.
The algorithm can be modified by performing multiple levels of jump search on the sublists, before finally performing the linear search. For an ''k''-level jump search the optimum block size ''m''''l'' for the ''l''th level (counting from 1) is ''n''(k-l)/k. The modified algorithm will perform ''k'' backward jumps and runs in O(''kn''1/(''k''+1)) time.
==Implementation==
Algorithm JumpSearch
Input: An ordered list ''L'', its length ''n'' and a search key ''s''.
Output: The position of ''s'' in ''L'', or nothing if ''s'' is not in ''L''.

''a'' ← 0
''b'' ← ⌊√''n''⌋

while ''L''min(''b'',''n'')-1 < ''s'' do
''a'' ← ''b''
''b'' ← ''b'' + ⌊√''n''⌋
if ''a'' ≥ ''n'' then
return nothing

while ''L''''a'' < ''s'' do
''a'' ← ''a'' + 1
if ''a'' = min(''b'',''n'')
return nothing

if ''L''''a'' = ''s'' then
return ''a''
else
return nothing

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Jump search」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.